#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Variable;

/// <summary>
/// VariableAction
/// VariableAction is an abstract class for Actions that operate on a specified
/// Variable.
/// </summary>
class UMLMODEL_EXPORT VariableAction : public Action {

public: // Constructors and destructors
    explicit VariableAction(const QString& umlType="uml::VariableAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// variable getter
    /// The Variable to be read or written.
    /// </summary>
    shared_ptr<Variable> variable() const;

    /// <summary>
    /// variable setter
    /// The Variable to be read or written.
    /// </summary>
    void setVariable(shared_ptr<Variable> value);

private: // Fields
    /// <summary>
    /// variable
    /// The Variable to be read or written.
    /// </summary>
    shared_ptr<Variable> variable_;

};

} // namespace uml
